package com.dycx.api.controller.app.user;


import com.dycx.common.RestResponse;
import com.dycx.common.context.UserInfoContext;
import com.dycx.user.dto.ReportDTO;
import com.dycx.user.service.ReportService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.validation.Valid;


/**
 * 收藏(Report)表控制层
 *
 * @author wuzongbing
 * @since 2024-04-17 15:51:44
 */
@RestController
@RequestMapping(value = "/app/system/report")
public class ReportApiController {
    /**
     * 服务对象
     */
    @Resource
    private ReportService reportService;

    /**
     * 添加
     *
     * @author wzb
     **/
    @PostMapping("create")
    public RestResponse<Boolean> create(@RequestBody @Valid ReportDTO dto) {
        dto.setUid(UserInfoContext.get().getUserId());
        return reportService.create(dto) ? RestResponse.success() : RestResponse.fail();
    }

}

